package com.minelx.woods.server.dao;

import org.apache.ibatis.session.SqlSession;

public class UserHelper {
	private final SqlSession session;

	private final UserRepository userRepository;

	private final UserDTO firstAddedUser;

	private final UserDTO secondAddedUser;

	public UserHelper(SqlSession session) {
		this.session = session;
		userRepository = session.getMapper(UserRepository.class);

		userRepository.removeAll();
		firstAddedUser = new UserDTO("name", "password");
		secondAddedUser = new UserDTO("name2", "password2");
		userRepository.add(firstAddedUser);
		userRepository.add(secondAddedUser);
	}

	public SqlSession getSession() {
		return session;
	}

	public UserRepository getUserRepository() {
		return userRepository;
	}

	public UserDTO getFirstAddedUser() {
		return firstAddedUser;
	}

	public UserDTO getSecondAddedUser() {
		return secondAddedUser;
	}
}
